<template>
    <div class="tipBox">
        <div>
            <span> 风险等级：</span>
            <div class="levelBox">
                <div
                    v-for="(item, index) in fourColor.polygons"
                    :key="index"
                    :style="{ background: item.style.color, color: item.style.fontColor }"
                >
                    {{ item.name }}
                </div>
            </div>
        </div>
        <div>
            <span>撤退路线：</span>
            <div>
                <img class="backImg" :src="require('@/asset/image/arrow.png')" alt="" />
            </div>
        </div>
    </div>
</template>

<script>
import fourColor from "../data";
export default {
    name: "RenderTip",
    data() {
        return {
            fourColor,
        };
    },
};
</script>

<style lang="scss" scoped>
.tipBox {
    position: absolute;
    color: #fff;
    font-size: 14px;
    left: 50%;
    bottom: 50px;
    width: 540px;
    margin-left: -270px;
    z-index: 9999;

    & > div {
        display: flex;
        align-items: center;
        margin-bottom: -50px;

        & > div {
            flex: 1;
            padding-left: 20px;
        }
    }
}

.levelBox {
    display: flex;
    justify-content: space-between;
    align-items: center;

    & > div {
        width: 100px;
        height: 30px;
        line-height: 30px;
        background: red;
        text-align: center;
        color: #fff;
        font-size: 12px;
        border-radius: 2px;
    }
}

.backImg {
    display: inline-block;
    height: 200px;
}
</style>
<style>
.leaflet-control-attribution {
    display: none;
}
</style>
